Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Add optional drag event handlers to dropzone #258

Merged
merged 2 commits into from
Apr 18, 2023

Conversation

Boughtmanatee5
Copy link
Contributor

@Boughtmanatee5 Boughtmanatee5 commented Apr 17, 2023

What this PR does

Add Drag event handler props to Dropzone component.

How it does that

  1. Add onDragEnter, onDragOver, onDragLeave, onDrop to Dropzone props
  2. Rename onDragOver, onDragLeave to handleDragOver, handleDragLeave.
  3. inside those handleDrag methods check if the corresponding onDrag prop is defined and call it with the drag event if it is.
  4. Pass the remaining drag event handlers to the div.

@Boughtmanatee5 Boughtmanatee5 force-pushed the 2023-04-17-add-drag-events-to-dropzone branch 2 times, most recently from c6a80ba to 03f6986 Compare April 17, 2023 20:27
@Boughtmanatee5 Boughtmanatee5 force-pushed the 2023-04-17-add-drag-events-to-dropzone branch from 03f6986 to e87dec8 Compare April 17, 2023 20:30
@Boughtmanatee5 Boughtmanatee5 marked this pull request as ready for review April 17, 2023 20:34
@Boughtmanatee5 Boughtmanatee5 requested review from a team as code owners April 17, 2023 20:34
Co-authored-by: kenneth-duverge <77157695+kenneth-duverge@users.noreply.github.com>
@juliewongbandue
Copy link
Collaborator

lgtm! I'm personally not too picky when it comes to the optional chaining vs. '&&' ... both are peppered throughout. So i'm fine with either here.

@Boughtmanatee5 Boughtmanatee5 merged commit 193ada4 into main Apr 18, 2023
@Boughtmanatee5 Boughtmanatee5 deleted the 2023-04-17-add-drag-events-to-dropzone branch April 18, 2023 13:41
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants